<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title><?php echo C('SITE_INFO.name');?></title>
<script type="text/javascript" src="__PUBLIC__/scripts/jquery-1.7.2.min.js"></script>
<link href="__PUBLIC__/Catalog/css/common.css" rel="stylesheet" type="text/css" />

<link href="__PUBLIC__/Catalog/css/detailsmm.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="main">
   <div class="title">
         <div class="title1">
             <a href="<?php echo U('Products/index');?>" id="back"> < </a>详情<a href="#" id="more">分享</a>
         </div>
   </div>
   <div class="content">
      <div class="pic">
      	<img src="__PUBLIC__/images/products/thumb/m_<?php echo ($productImages[0]['image']); ?>" />
      <!-- 	<?php if($productImages == ''): ?><img src="__PUBLIC__/Catalog/images/pic.png" /><?php endif; ?>
	      <?php if(is_array($productImages)): foreach($productImages as $key=>$vo): ?><img src="__PUBLIC__/images/products/thumb/m_<?php echo ($vo["image"]); ?>" /><?php endforeach; endif; ?> -->
      </div>
      <div class="des"><p><?php if($productsDetail['products_type'] == 2): ?>[拍卖]<?php else: ?>[一口价]<?php endif; echo ($productsDetail["products_name"]); ?></p></div>
      <div class="date"><span id="dates"><?php echo ($productsDetail["products_date_added"]); ?></span><span id="clicks"><?php echo ($productsDetail["viewd"]); ?></span><a href="<?php if($uid == ''): echo U('Products/collect');?>?pid=<?php echo ($productsDetail["products_id"]); else: ?>javascript:collect('<?php echo ($productsDetail["products_id"]); ?>','<?php echo ($uid); ?>');<?php endif; ?>" id="co">收藏</a></div>
      <div id="ads">
         	<p><span id="ads1">个人</span>
         	<?php if($productsDetail['products_type'] == 3): ?>公益品<?php else: ?>一口价<strong id="ads2"><?php echo ($productsDetail["products_price"]); ?>元</strong><?php endif; ?></p>
            <p><span id="ads3"><?php echo ($productsDetail["city_name"]); ?>-<?php echo ($productsDetail["area_name"]); ?></span></p>
           	<?php if($productsDetail['products_type'] == 3): ?><span onclick="<?php if($productsDetail['uid'] == $uid): ?>javascript:alert('不能获取自己发布的公益商品');<?php else: ?>javascript:$('#buyconfirm').css('display','block');<?php endif; ?>" class="xiadan">下单获取</span><?php endif; ?>
	            <?php if($productsDetail['products_type'] == 2): ?><a href="<?php if($productsDetail['uid'] == $uid): ?>javascript:alert('不能给自己发布的商品出价');<?php else: echo U('Products/auction');?>?pid=<?php echo ($productsDetail["products_id"]); endif; ?>" style="margin-left:20px;" class="xiadan">拍卖出价</a><?php endif; ?>
	           <?php if($productsDetail['products_type'] == 2 || $productsDetail['products_type'] == 1): ?><span onclick="<?php if($productsDetail['uid'] == $uid): ?>javascript:alert('不能购买自己发布的商品');<?php else: ?>javascript:$('#buyconfirm').css('display','block');<?php endif; ?>" class="xiadan">下单购买</span><?php endif; ?>
          
      </div>
      <div id="contact">
         	<p><span id="contact1">  <?php echo ($productsDetail["contact_person"]); ?> 【交易评分5.0分】</span><a href="javascript:$('#contacttel').css('display','block');" class="xiadans">联系电话</a></p>
            <p><span id="contact3"><?php echo ($productsDetail["contact_wechat"]); ?></span></p>
            <?php if($productsDetail['contact_qq'] != ''): ?><a href="#<?php echo ($productsDetail["contact_qq"]); ?>" id="xiadans">联系QQ</a><?php else: ?><a href="<?php echo U('Products/leaveword');?>?publishuid=<?php echo ($productsDetail["uid"]); ?>&pid=<?php echo ($productsDetail["products_id"]); ?>" id="xiadans">给我留言</a><?php endif; ?>
            <a href="#<?php echo ($productsDetail["contact_tel"]); ?>" id="xiadans2">拨打电话</a>
      </div>
      <div id="contact11">
         	<p><span id="contact111"> 拍卖纪录</p>
            <p>
            	<span id="contact112">起步价：<?php echo ($productsDetail["products_paimai_price"]); ?></span><br/>
            	<?php if(is_array($nowprice)): foreach($nowprice as $key=>$vo): ?><span id="contact112"><?php echo ($vo["price"]); ?>元--<?php echo ($vo["add_date"]); ?></span><?php endforeach; endif; ?>
            </p>
      </div>
      <div id="ct">
            <p><span id="ct2">详细描述 >></span><a href="<?php echo U('Products/report');?>?pid=<?php echo ($productsDetail["products_id"]); ?>" id="ct1">举报商品</a></p>
            <p id="cts"><?php echo ($productsDetail["products_description"]); ?></p>
      </div>
      <div id="ewei">
            <p id="ewei2"><img src="__PUBLIC__/Catalog/images/ewei.png" /></p>
            <p id="ewei1">长按图片识别二维码，关注获取更多相关信息</p>
      </div>
      <div id="list">
          <div id="listTitle">其它信息 >></div>
          <div class="products_list">
           <table>
                <?php if(is_array($productlist)): foreach($productlist as $key=>$vo): ?><tr bordercolor="#FF0000">
                    <td style="width:80px; height:70px;"><a href="#"><img src="__PUBLIC__/images/products/<?php echo ($vo["products_image"]); ?>" /></a></td>
                    <td style="width:190px; height:70px; padding-left: 5px;">
                        <dl class="dls">
                           <dt><a href="#" style="font-size:18px; color:#000;"><?php echo ($vo["products_name"]); ?></a></dt>
                           <dd><a href="#" class="phone"><?php echo ($vo["contact_tel"]); ?>  <?php echo ($vo["contact_person"]); ?></a></dd>
                           <dd><a href="#" class="dingwei"><?php echo ($vo["prov_name"]); ?>-<?php echo ($vo["city_name"]); ?></a></dd>
                           <dd><span class="time"><?php echo ($vo["products_date_added"]); ?></span> <span class="what"><?php echo ($vo["viewd"]); ?></span></dd>
                        </dl>
                    </td>
                    <td style="width:70px; height:70px;">
                           <p class="cc"><?php if($vo['up_flag'] == 1): ?><a href="#" class="ding"></a><?php endif; ?>
                           <?php if($vo['jiaji_flag'] == 1): ?><a href="#" class="ji"></a><?php endif; ?></p>
                    </td>
                </tr><?php endforeach; endif; ?>
           </table>
           </div>
      </div>
   </div>
</div>
<div class="foot"><p><a href="<?php echo U('Products/index');?>?cid=<?php echo ($cid); ?>">查看更多手机配件信息</a></p></div>
<div class="foot1" style="display:none;" id="buyconfirm">
    <div class="foot2">
        <span class="foot2i">确认提示：</span>
        <a class="foot2x" onclick="javascript:$('#buyconfirm').css('display','none');" ></a>
    </div>
    <div class="foot2Select">
    	<p>建议您先联系卖家确认后再行购买或获取</p>
        <a class="go" id="havenshow" href="<?php echo U('Order/index');?>?pid=<?php echo ($productsDetail["products_id"]); ?>">已确认</a>
        <a class="del" id="noshow"  href="javascript:$('#buyconfirm').css('display','none');">再看看</a>
    </div>
</div>

<div class="foot1" style="display:none;" id="contacttel">
    <div class="foot2">
        <span class="foot2i">联系方式：</span>
        <a class="foot2x" onclick="javascript:$('#contacttel').css('display','none');" ></a>
    </div>
    <div class="foot2Select">
    	<?php echo ($productsDetail["contact_tel"]); ?> 
    </div>
</div>
<script>
$(function(){
    if('<?php echo ($msg); ?>'!='0'){
        alert('<?php echo ($msg); ?>');
    }
});
function collect(pid,uid){
	$.ajax({
		type:"post",
		url:"<?php echo U('Products/collect');?>",
		datatype:'json',
		data:{pid:pid,uid:uid},
		success:function(result){
			datacontent =window.JSON.parse(result);
				alert(datacontent.msg);
		},
		error: function(XMLHttpRequest, textStatus, errorThrown) {
			alert(XMLHttpRequest.status);
			alert(XMLHttpRequest.readyState);
			alert(textStatus);
		},
	});
}

</script>
<div class="index-foot">
    <div class="index-foot2">
            <ul>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Index/index');?>"><img src="__PUBLIC__/Catalog/images/house.png" /></a></dd>
                      <dd><a href="<?php echo U('Index/index');?>">首页</a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Products/index');?>"><img src="__PUBLIC__/Catalog/images/cate1.png" /></a></dd>
                      <dd><a href="<?php echo U('Products/index');?>">商品</a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd><a href="<?php echo U('Mproducts/publish');?>"><img src="__PUBLIC__/Catalog/images/jia.png"style=" width:50px; height:50px;" /></a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Membership/leaveword');?>"><img src="__PUBLIC__/Catalog/images/<?php if($count > 0): ?>message-hot.png<?php else: ?>message.png<?php endif; ?>" /></a></dd>
                      <dd><a href="<?php echo U('Membership/leaveword');?>">信息</a></dd>
                  </dl>
              </li>
              <li>
                  <dl>
                      <dd class="index-dds"><a href="<?php echo U('Membership/index');?>?uid=<?php echo ($uid); ?>"><img src="__PUBLIC__/Catalog/images/men.png" /></a></dd>
                      <dd><a href="<?php echo U('Membership/index');?>?uid=<?php echo ($uid); ?>">我的</a></dd>
                  </dl>
              </li>
            </ul>       
    </div>
</div>
</body>
</html>